package com.ebei.admin.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.ebei.admin.mapper.SysOrgRoleUserMapper;
import com.ebei.admin.model.entity.SysOrgRoleUser;
import com.ebei.admin.service.SysOrgRoleUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("sysOrgRoleUserService")
public class SysOrgRoleUserServiceImpl extends ServiceImpl<SysOrgRoleUserMapper,SysOrgRoleUser> implements SysOrgRoleUserService {
    @Autowired
    private SysOrgRoleUserMapper sysOrgRoleUserMapper;

    @Override
    public Boolean updateResponsible(Integer positionId, Integer userId, String responsible) {

        SysOrgRoleUser condition = new SysOrgRoleUser();
        condition.setPositionId(positionId);
        condition.setUserId(userId);

        SysOrgRoleUser sysOrgRoleUser = new SysOrgRoleUser();
        sysOrgRoleUser.setResponsible(responsible);
        return this.update(sysOrgRoleUser,new EntityWrapper<>(condition));
    }
}
